Welcome to the Background Randomizer!  It's purpose is to pick a random image file from a list you provide, save it off as a bitmap, then tell Windows to use it as your desktop wallpaper.  Now, there are probably hundreds of programs like this one, but this one has some advantages:

1. You already have it.
2. It has this cool mirroring feature which I haven't seen in any other Windows program.
3. You can slideshow your backgrounds if you want to show them off to other people.

To use the Randomizer you need to run it with a command line that tells it what file list to use.  If you just double-click on the program it will tell you it has no file list.  So, what you need is a file list and a way to tell the Randomizer where that list is.

The file list is actually just a text file.  The best way to create it is to use the configuration tool, BakCnf, which is explained below.  Once you've got your text file built you need to set the Randomizer to load it when it runs.  That's where the command line comes in.

There are a lot of ways to run a program with a command line.  For this program, the Windows' shortcut provides the best way.  To do this, just make a shortcut to the background randomizer program.  Right click on this shortcut, select properties, and go to the Shortcut tab.  You'll see a text box for "Target" that will have something like:

"C:\Program Files\Background Randomizer\Background Randomizer.exe"

Edit this line to be something like:

"C:\Program Files\Background Randomizer\Background Randomizer.exe" C:\MyBaks.Txt

Where 'C:\MyBacks.Txt' should be the name and path of your file list.  Now you can copy this shortcut into the Program\StartUp in your Start menu or just leave it on the desktop and click it when you feel like changing the background.

The Background Randomizer can take GIF files, JPEG files, BMP files, Windows Metafiles, RLE files, and, if you are feeling particularly bizzare, icon files.


BAKCNF.EXE

Bakcnf is a tool that is used to build file lists for the Randomizer.

There are two ways to build your file list.  The easiest way is by simply dragging the files you want over to the big list box on the right.  The second way is to specify the drive the file is in, then the directory, then select the files you want to add and click the 'Add Selected Files' button.  This is all done on the left half of the program.  You can also add entire directories by clicking the 'Add Selected Directory' button.  When you do this, Bakcnf runs through the selected directory and all its subdirectories and adds all the files it finds.

Note that Bakcnf makes no effort to see if the files are really image files.  It trusts you completely.  If you get a file in the list that you don't want, just select it on the right side and click the 'Remove Selected Files' button.  The Background Randomizer currently takes GIF, JPEG, BMP, RLE, windows Metafile, and (if you are feeling really bizarre) icon files.

When you add a file to your list you can also choose the manner in which the Randomizer will display the file.  There are three options: normal, tiled, and mirror tiled.  The file will be displayed in whatever format is selected when the file is added.

Normal and tiled format you already know.  Those are the standard Windows background methods.  Mirror tiled is like tiled but, instead of just repeating the image over and over, it does some flipping and rotating so the edges merge together nicely.  The best way to understand this is to just try it out.  Use it on smallish (less than one quarter of your screen size) files.  Little 320x200 pictures of scenery do nicely.

You should also specify where you want the Randomizer to save your wallpaper.  The default is C:\Windows\Bak.bmp, which will be fine for most folks.  If you aren't most folks then simply change the path to what you want.

If you want to see what a file will look like, select the file on the left side of the program and click the 'Preview Selected File' button.  Click the close button in the lower right of the preview window when you're done.

You can also see a slideshow of all your entire file list.  Just click the Slideshow button and away you go.  When you get tired of it, click the Close button.  If the slideshow goes too fast or slow for you, you can change how fast it switches by changing the number of seconds in the lower right before clicking the Slideshow button.

Load, Save, and Save As are used to save your file list and act pretty much as you expect.  


Mirrors On Demand

If you're really Windows savvy you can set your system up so you can set a mirrored version of any supported image file as your background just by right clicking and selecting a menu option.  I've only tested this under Windows 95 with Active Desktop, but I'm pretty sure it will work in other Windows operating systems.

You do this by adding an option to the file type.  (Under Active Desktop, you edit these by the view->Folder Options menu in the File Types tab.)  Select the JPEG Image type and edit it.  Make a new action called Mirror.  Have this action run the Background Randomizer.  No DDE needed.  [Do NOT make this new action the default action.  Active Desktop really hates it when you do!]

Now, when you right click on a jpg file, you should see a new Mirror option in the menu.  When you select this option, Windows runs the Background Randomizer and passes the file name as a command parameter for you.  When the Randomizer gets an image file it assumes you want to mirror tile the image and saves the result in its own directory as QuickOne.bmp.


How It's Done

It took a little work to get this going correctly under Active Desktop.  The important registry key is HKEY_CURRENT_USER\Control Panel\Desktop in the Wallpaper and TileWallpaper values.  That isn't enough, though.  To get the wallpaper to update, you have to call the SystemParametersInfo API a couple of times.  Once for the wallpaper then once for the desktop pattern.  That gets whatever other registry values are needed to update correctly.

The mirror effect is pretty simple.  The StretchBlt API with negative widths and heights gets it done quite nicely.


Legal

These programs are distributed AS IS.  If you manage to hurt yourself or your system with it, then that's too bad.  You are free to distribute these programs to anyone you wish as long as this Readme file is distributed along with them.



Written by Bob Bingham (sloth@sky.net)
Support page is at www.sky.net/~sloth/RandBak.html
